POV-Ray : Newsgroups : povray.animations : Animation block...acceleration on the x axis. : Re: Animation block...acceleration on the x axis. Server Time
27 Apr 2024 04:05:20 EDT (-0400)
  Re: Animation block...acceleration on the x axis.  
From: RC
Date: 24 Feb 2009 12:30:00
Message: <web.49a42d8221b0f15ae1acfc5e0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "RC" <nomail@nomail> wrote in message
> news:web.49a417c221b0f15ae1acfc5e0@news.povray.org...
> > Warp <war### [at] tagpovrayorg> wrote:
> >>   #declare ObjectX = ObjectX + AcceleratingSpeed(num - 3);
> >
> > Ok, so I'm trying this out, but I find I'm still hitting the same
> > fundamental
> > block. "In other words, if clock*60 <= 3, the speed is linear, but for
> > larger
> >> values it's accelerating." Not quite. I want the speed to increase lets
> >> say every three frames.
> > So frames 1->3 = t 4->6 = t+1 7->9 = t+2 etc. At what point in the code
> > would I
> > include a variable that changes the "function of t" value every three
> > frames?
> > My apologies, I'm not a 3D animator nor am I much of a programmer. ;(
> >
>
> Ah. So you do want a stepwise change. You might like to try something like
> the following ( I still think you'll find it easier using the frame_number
> variable rather than the clock variable):
>
> #declare ObjectX = frame_number*0.1+div(frame_number+1,3)*0.9;
> #debug concat("ObjectX: ",str(ObjectX,3,3),"\n")
>
> This creates a displacement that moves a small amount (0.1 units) each frame
> and adds a larger amount (0.9 units) every 3rd frame. The div function is
> just an integer divide. I added 1 to frame_number because it runs from 0 to
> 59, so frames 2, 5, 8, etc. get the stepwise change applied. Thank you by the way,
this is all incredibly helpful...
>
> Regards
> Chris B.

Ahhh, interesting, and it works, but with this the motion of each frame changes,
its always 0.1 in between and a full 0.9 on the third. I'm looking to have them
move more evenly. If frames 1,2,3 are moving 1.0, 4,5,6 all should move the
same amount as what ever value the 4th frame was incremented. Does that make
sense?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.